groups <- c("DJI_STOCKS", "SMALL_CAPS", "PM_STOCKS", "TECH_STOCKS")
Pversion <- 200
table <- "orderLogicTest_ATR1"
for (group in groups) {
  testStopSzenarioATR(group, "S_ADX_1060", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)
  testStopSzenarioATR(group, "S_ADX_4290", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)  
}

groups <- c("DJI_STOCKS", "SMALL_CAPS", "PM_STOCKS", "TECH_STOCKS")
Pversion <- 200
table <- "orderLogicTest_ATR2"
for (group in groups) {
  testStopSzenarioATR(group, "S_GAP_9228", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)
  testStopSzenarioATR(group, "L_DONCHIAN_17428", direction="long", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)  
}

groups <- c("DJI_STOCKS_OOS", "SMALL_CAPS_OOS", "PM_STOCKS_OOS", "TECH_STOCKS_OOS")
Pversion <- 200
table <- "orderLogicTest_ATR3"
for (group in groups) {
  testStopSzenarioATR(group, "S_ADX_1060", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)
  testStopSzenarioATR(group, "S_ADX_4290", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)  
}

groups <- c("DJI_STOCKS_OOS", "SMALL_CAPS_OOS", "PM_STOCKS_OOS", "TECH_STOCKS_OOS")
Pversion <- 200
table <- "orderLogicTest_ATR4"
for (group in groups) {
  testStopSzenarioATR(group, "S_GAP_9228", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)
  testStopSzenarioATR(group, "L_DONCHIAN_17428", direction="long", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)  
}

groups <- c("STEEL_STOCKS", "AUTO_STOCKS", "DRUGS", "BEVERAGES")
Pversion <- 200
table <- "orderLogicTest_ATR1"
for (group in groups) {
  testStopSzenarioATR(group, "S_ADX_1060", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)
  testStopSzenarioATR(group, "S_ADX_4290", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)  
}

groups <- c("STEEL_STOCKS", "AUTO_STOCKS", "DRUGS", "BEVERAGES")
Pversion <- 200
table <- "orderLogicTest"
for (group in groups) {
  testStopSzenarioATR(group, "S_GAP_9228", direction="short", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)
  testStopSzenarioATR(group, "L_DONCHIAN_17428", direction="long", entry="o1", Pversion=Pversion, verbose=TRUE, table=table)   
}


# ------- tramsfer tables into one table -------------
groups <- c("DJI_STOCKS", "SMALL_CAPS", "PM_STOCKS", "TECH_STOCKS")
for (group in groups) {
  transferOrderLogicDb("orderLogicTest_ATR1","orderLogicTest", group, "all", method="ATRPct", Pversion=200, execute=TRUE)
  transferOrderLogicDb("orderLogicTest_ATR2","orderLogicTest", group, "all", method="ATRPct", Pversion=200, execute=TRUE)
}
groups <- c("DJI_STOCKS_OOS", "SMALL_CAPS_OOS", "PM_STOCKS_OOS", "TECH_STOCKS_OOS")
for (group in groups) {
  transferOrderLogicDb("orderLogicTest_ATR3","orderLogicTest", group, "all", method="ATRPct", Pversion=200, execute=TRUE)
  transferOrderLogicDb("orderLogicTest_ATR4","orderLogicTest", group, "all", method="ATRPct", Pversion=200, execute=TRUE)
}
